﻿<UserControl x:Name="CtrlGauge"
             x:Class="Titler.Controls.GaugeCtrl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:data="clr-namespace:Titler.ControlModels"
             xmlns:Properties="clr-namespace:Titler.Properties"
             mc:Ignorable="d"  
             MinWidth="200">


    <UserControl.Resources>
        <Style x:Key="{x:Type Label}" TargetType="{x:Type Label}">
            <Setter Property="Padding" Value="2"/>
            <Setter Property="Margin" Value="0,0,0,2"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Height" Value="30"/>
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontSize" Value="12pt"/>
        </Style>
        <Style x:Key="{x:Type ComboBox}" TargetType="{x:Type ComboBox}">
            <Setter Property="Padding" Value="2"/>
            <Setter Property="Margin" Value="0,0,0,2"/>
            <Setter Property="Background">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFF3F3F3" Offset="0.45"/>
                        <GradientStop Color="#FFE0E0E0" Offset="0.55"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="BorderBrush" Value="#FF707070"/>
            <Setter Property="Height" Value="30"/>
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontSize" Value="12pt"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
        </Style>
        <data:PMControlModel x:Key="pMControlModelView" />
    </UserControl.Resources>


    <Grid DataContext="{StaticResource pMControlModelView}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <StackPanel>
            <Label x:Name="Txt_Family" Content="Family" Margin="0,0,0,2" d:LayoutOverrides="Height"/>
            <Label x:Name="Txt_Diameter" Content="Diameter (in)" Margin="0,0,0,2"/>
            <Label x:Name="Txt_Config" Content="Config" Margin="0,0,0,2"/>
            <Label x:Name="Txt_Pressure" Content="Pressure (ksi)" Margin="0,0,0,2"/>
            <Label x:Name="Txt_Temp" Content="Temp (C)" Margin="0,0,0,2"/>
            <Label x:Name="Txt_DTDR" Content="DT / DR" Margin="0,0,0,2"/>
            <Label x:Name="Txt_Feedthru" Content="Feedthru" Margin="0,0,0,2"/>
            <Label x:Name="Txt_Seal" Content="Seal" Margin="0"/>
        </StackPanel>
        <StackPanel Grid.Column="1">
            <ComboBox x:Name="GaugeFamily" Text="{Binding GaugeFamily}"
                      ItemsSource="{Binding Source={x:Static Properties:Settings.Default}, Path=List_GaugeFamily}"
                      Margin="0,0,0,2" d:LayoutOverrides="Height" SelectedIndex="-1"
                      IsSynchronizedWithCurrentItem="True"
                      Cursor="Cross"
                      ToolTip="Gauge Family" />
            <ComboBox x:Name="GaugeDiameter" Text="{Binding GaugeDiameter}"
                      ItemsSource="{Binding Source={x:Static Properties:Settings.Default}, Path=List_GaugeDiameter}"
                      Margin="0,0,0,2" IsSynchronizedWithCurrentItem="True"
                      Cursor="Cross"
                      ToolTip="Gauge Diameter" />
            <ComboBox x:Name="Config" Text="{Binding Config}"
                      ItemsSource="{Binding Source={x:Static Properties:Settings.Default}, Path=List_Config}"
                      Margin="0,0,0,2" IsSynchronizedWithCurrentItem="True"
                      Cursor="Cross"
                      ToolTip="Gauge Configuration" />
            <ComboBox x:Name="GaugePressure" Text="{Binding GaugePressure}"
                      ItemsSource="{Binding Source={x:Static Properties:Settings.Default}, Path=List_GaugePressure}"
                      Margin="0,0,0,2" IsSynchronizedWithCurrentItem="True" IsEditable="True" Cursor="Cross" 
                      LostFocus="Control_Add_Item"
                      ToolTip="Gauge Pressure Rating" />
            <ComboBox x:Name="GaugeTemp" Text="{Binding GaugeTemp}"
                      ItemsSource="{Binding Source={x:Static Properties:Settings.Default}, Path=List_GaugeTemp}"
                      Margin="0,0,0,2" IsSynchronizedWithCurrentItem="True" IsEditable="True" Cursor="Cross" 
                      LostFocus="Control_Add_Item"
                      ToolTip="Gauge Temperature Rating" />
            <ComboBox x:Name="GaugeDTDR" Text="{Binding GaugeDTDR}"
                      ItemsSource="{Binding Source={x:Static Properties:Settings.Default}, Path=List_GaugeDTDR}"
                      Margin="0,0,0,2" IsSynchronizedWithCurrentItem="True"
                      Cursor="Cross"
                      ToolTip="Dual Transducer (Sensor) or Dual Redundant Gauge" />
            <ComboBox x:Name="Feedthru" Text="{Binding Feedthru}"
                      ItemsSource="{Binding Source={x:Static Properties:Settings.Default}, Path=List_Feedthru}"
                      Margin="0,0,0,2" IsSynchronizedWithCurrentItem="True"
                      ToolTip="Feedthrough Gauge"
                      Cursor="Cross" />
            <ComboBox x:Name="GaugeSeal" Text="{Binding GaugeSeal}"
                      ItemsSource="{Binding Source={x:Static Properties:Settings.Default}, Path=List_GaugeSeal}"
                      Margin="0" IsSynchronizedWithCurrentItem="True"
                      ToolTip="Dual or Single Metal Seal Cable Termination"
                      Cursor="Cross" />
        </StackPanel>
    </Grid>
</UserControl>
